import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'

export default tseslint.config({
  extends: [js.configs.recommended, ...tseslint.configs.recommended],
  files: ['**/*.{ts,tsx}'],
  ignores: ['dist'],
  languageOptions: {
    ecmaVersion: 2020,
    globals: globals.browser,
  },
  plugins: {
    'react-hooks': reactHooks,
    'react-refresh': reactRefresh,
  },
  rules: {
    ...reactHooks.configs.recommended.rules,
    'react-refresh/only-export-components': [
      'warn',
      { allowConstantExport: true },
    ],
    // "@typescript-eslint/no-unused-vars" : "off",// 关闭不允许未使用变量
    // '@typescript-eslint/no-explicit-any': 'off',
    // '@typescript-eslint/ban-types': 'off',
    // '@typescript-eslint/object-curly-spacing': 'off',
    // '@typescript-eslint/explicit-module-boundary-types': 'off',
    // '@typescript-eslint/no-unsafe-argument': 'off',
    // '@typescript-eslint/no-unsafe-return': 'off',
    // '@typescript-eslint/no-empty-function': 'off',
    // '@typescript-eslint/no-unnecessary-type-assertion': 'off',
    // '@typescript-eslint/restrict-plus-operands': 'off',
    // '@typescript-eslint/no-floating-promises': 'off',
    // '@typescript-eslint/restrict-template-expressions': 'off',
    // '@typescript-eslint/no-misused-promises': 'off',
    // 'require-atomic-updates': 'off',
    // 'import/no-unresolved': 'off',
    // 'import/no-extraneous-dependencies': 'off',
    // 'no-param-reassign': 'off',
    // 'no-use-before-define': 'off',
    // 'no-explicit-any': 'off',
    // 'no-underscore-dangle': 'off',
    // 'react/default-props-match-prop-types': 'off',
    // 'react/require-default-props': 'off',
    // 'react-hooks/exhaustive-deps': 'off', // Checks deps of Hooks
    // 'react/display-name': 'off',
    // 'react/prop-types': 'off'
  },
})
